# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Ronald van Haren <ronald.archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=libktorrent
pkgver=2.1
_ktorrentver=5.1
pkgrel=1
pkgdesc="A BitTorrent protocol implementation"
arch=(x86_64)
url="https://www.kde.org/applications/internet/ktorrent/"
license=(GPL2)
depends=(kio qca-qt5)
makedepends=(extra-cmake-modules boost doxygen)
source=("http://download.kde.org/stable/ktorrent/$_ktorrentver/$pkgname-$pkgver.tar.xz"{,.sig})
sha256sums=('3eefdcceec73410c558e82d7be22eb2ed18679e9ab64f34cc100b54e186fe26f'
            'SKIP')
validpgpkeys=(1EE5A3205904BAA2B88C0A9D24FD31940095C0E1) # Andrius Štikonas <andrius@stikonas.eu>

prepare() {
  mkdir -p build
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DKDE_INSTALL_LIBDIR=lib
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
